/*
 * @Author: li bo
 * @Date: 2025/07/14 09:58:44
 * @LastEditors: li bo
 * @Description: "播放列表模型"
 */
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("play_list", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            comment: '唯一标识',
            defaultValue: Sequelize.UUIDV4,
        },
        name: {
            type: Sequelize.STRING(100),
            allowNull: false,
            comment: '播放列表名称',
        },
        description: {
            type: Sequelize.TEXT,
            comment: '播放列表描述',
        },
        coverUrl: {
            type: Sequelize.STRING(255),
            defaultValue: '../../public/web-site/website-avatar.jpg',
            comment: '封面URL',
            field: 'cover_url',
        },
        isPublic: {
            type: Sequelize.BOOLEAN,
            defaultValue: true,
            comment: '是否公开',
            field: 'is_public',
        },
        songCount: {
            type: Sequelize.INTEGER,
            defaultValue: 0,
            comment: '歌曲数量',
            field: 'song_count',
        },
    })
}
